<!doctype html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script src="../assert_selection.js"></script>
<script>
// Specifically checks test case in bug: <rdar://problem/3917929> REGRESSION
// (Mail): Command-left-arrow leaves insertion point too high after specific
// steps
selection_test(
  '<div contenteditable><div>|foo</div>bar</div>',
  selection => selection.modify('move', 'forward', 'word'),
  '<div contenteditable><div>foo|</div>bar</div>',
  'Move forward word 1');

selection_test(
  '<div contenteditable><div>foo|</div>bar</div>',
  selection => selection.modify('move', 'forward', 'word'),
  '<div contenteditable><div>foo</div>|bar</div>',
  'Move forward word 2');

selection_test(
  '<div contenteditable><div>foo</div>bar|</div>',
  selection => selection.modify('extend', 'backward', 'word'),
  '<div contenteditable><div>foo</div>|bar^</div>',
  'Extend backward word');
</script>
